package ru.msu.phys.cmp.mpga.domain.bresenham;

import ru.msu.phys.cmp.mpga.domain.Point;

public class BresenhamEllipse extends BresenhamObject{

	public BresenhamEllipse(final int a, final int b) {
	   	int x = 0;
	   	int y = b;
	   	double F=a * a * (b - 0.25);
	   	points.add(new Point(x,y));
	  	while (y > 0) {
	   	    if(F >= 0) {
	   		    x++;
	   		    F = F + (b * b) * (1 - 2 * x);			       
	   	    }
	   		if(F < 0) {
	   		    y--;
	   		    F = F - a* a * (1 - 2 * y); 
	   		}
	   		points.add(new Point(x,y));
	  	}
	}


}